<template>
  <div>
    <h2>我是count组件</h2>

<!--<button @click="count++">累加</button>-->
    <button @click="add">查看组件实例</button>
    <p class="count">{{count}}</p>
  </div>
</template>


<script>
export default {
  name:"count",
    data(){
      return{
        count1:this.count
      }
    },
    //接收父组件传过来的值
    props:["count"],
    methods:{
      add(){
        //Count组件实例对象
        console.log(this);
        console.log(this.count)
        console.log(this.$props.count)
      }
    }
}
</script>


<style></style>